<div id="addnew_hotel_room_type_images"></div>
<%= hidden_field_tag "hid", params[:hid] %>
<div id="hotel_room_types_table">
  <%= form_tag destroy_multiple_hotel_room_types_path, remote: true, method: :delete do %>
  <table>
    <tr>
      <td> 
        <%= link_to 'back', hotel_room_types_path({hid: params[:hid]}), class: "btn btn btn-inverse", remote: true %>    
      </td>
      <td>  
        <%= submit_tag "Delete selected", id: "btn_selected", class: "btn btn-primary", disabled: "disabled", data: { confirm: 'Are you sure delete this selected hotel room type?' } %>
      </td>
    </tr>
  </table>
  <table class="table">
    <thead>
      <tr>
        <th style="text-align:center;"> Images </th>
        <th> Description </th>
        <th style="text-align:center;">Action</th>
      </tr>
    </thead>

    <tbody id="hotel_room_type_images">
      <% if @hotel_room_type_images.empty? %>
        <tr id="empty">
          <td>Empty</td>
        </tr>
      <% else %>
        <% @hotel_room_type_images.each do |hrti| %>
          <tr id="tr_<%= hrti.id %>">        
              <td class="text-center">
                <%= image_tag hrti.image.url(:thumb) %>
              </td>
              <td>
                <%= (hrti.description_eng.blank?)? "None" : hrti.description_eng %>
              </td>
              <td class="text-center"> 
                <%= link_to 'Delete', {controller: 'hotel_room_type_images', action: 'destroy' , id: hrti.id , hid: params[:hid] }, method: :delete, remote: true, data: { confirm: 'Are you sure?' }, class: "btn btn-danger" %>
              </td>
          </tr>
        <% end %>
      <% end %>
    </tbody>
  </table>
  <% end %>

  <div class="collection_paginator">
    <%#= will_paginate hotel_room_types %>
  </div>
</div>

<div id="add_image" class="well">
  <div class="row-fluid">
    <div id="primary_form" class=" span12">
      <%= form_for(@hotel_room_type_image, :html => {remote: true, id: "form_hotel_image" }) do |f| %>           
          <%= f.hidden_field :hotel_room_type_id, {value: params[:hrt]} %>
          <%= f.file_field :image, class: "checkbox" %>
          <%= f.text_area :description_eng, class: "dec_image", style: "width: 400px; height:25px;", :placeholder => "Image Description ..." %>
          <%= f.submit "Add Image", class: "btn btn-primary checkbox", style: "margin-left:30px;" %> 
      <% end %>
    </div>  
  </div> 
</div>